﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.ComponentModel.DataAnnotations;

namespace Iacym.Entities
{
    public class CELULA : BaseEntity
    {
        public CELULA()
        {
            this.PERSONAs = new List<PERSONA>();
        }

        public int Id { get; set; }
        
        [Display(Name="Descripcion")]
        [Required(ErrorMessage="Se Requiere una Descripción")]
        public string Descripcion { get; set; }

        [Display(Name = "MinisterioId")]
        [Required(ErrorMessage = "Se Requiere un Ministerio")]
        public int MinisterioId { get; set; }

        [Display(Name = "MinisterioId")]
        [Required(ErrorMessage = "Se Requiere un Ministerio")]
        public virtual MINISTERIO MINISTERIO { get; set; }
        
        public virtual ICollection<PERSONA> PERSONAs { get; set; }

        public override string ToString()
        {
            return Descripcion + " - " + MINISTERIO.Descripcion;
        }
    }
}
